/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.TradeClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.enation.app.javashop.model.security.ScanModuleDTO;
import com.enation.app.javashop.model.security.ScanResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 交易client fallback
 * @author zs
 * @version 1.0
 * @since 7.1.0
 * 2021-12-21
 */
@Component
public class TradeClientFallbackFactory extends BaseFallbackFactory<TradeClientFeignImpl> implements FallbackFactory {


    @Override
    protected TradeClientFeignImpl fallback() {
        return new TradeClientFallback();
    }

    /**
     * 交易client fallback
     * @author zs
     * @version 1.0
     * @since 7.1.0
     * 2021-12-21
     */
    @Component
    public static class TradeClientFallback implements TradeClientFeignImpl {

        protected final Logger logger = LoggerFactory.getLogger(this.getClass());

        @Override
        public ScanResult scanModule(ScanModuleDTO scanModuleDTO) {
            logger.error("交易服务调用失败，scanModule");
            return null;
        }

        @Override
        public void reSign() {
            logger.error("交易服务调用失败，reSign");
        }

        @Override
        public void repair(Long tradeId) {
            logger.error("交易服务调用失败，repair");
        }
    }
}
